﻿using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using WebApiClientCore.Attributes;
using XUCore.WeChat.Apis;

namespace XUCore.WeChat.Enterprise.Apis.Group.Message
{
    /// <summary>
    /// https://developer.work.weixin.qq.com/document/path/91023
    /// </summary>
    [HttpHost("https://qyapi.weixin.qq.com/cgi-bin/")]
    public interface IEnterpriseGroupMessageApi : IEnterpriseWeChatApiWithAccessTokenFilter
    {
        // /// <summary>
        // /// 创建企业群发<para/>
        // /// 
        // /// 1、对于客户群发，sender，external_userid，tag_filter不可同时为空，如果指定了external_userid,则tag_filter不生效<para/>
        // /// 2、text和attachments不能同时为空<para/>
        // /// 3、attachments中每个附件信息必须与msgtype一致，例如，msgtype指定为image，则需要填写image.pic_url或者image.media_id，否则会报错。<para/>
        // /// 4、media_id和pic_url只需填写一个，两者同时填写时使用media_id，二者不可同时为空<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/92135"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/add_msg_template")]
        // Task<AddTemplateApiResult> AddTemplateAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] AddTemplateInput input);
        /// <summary>
        /// 创建企业群发<para/>
        /// 
        /// 1、对于客户群发，sender，external_userid，tag_filter不可同时为空，如果指定了external_userid,则tag_filter不生效<para/>
        /// 2、text和attachments不能同时为空<para/>
        /// 3、attachments中每个附件信息必须与msgtype一致，例如，msgtype指定为image，则需要填写image.pic_url或者image.media_id，否则会报错。<para/>
        /// 4、media_id和pic_url只需填写一个，两者同时填写时使用media_id，二者不可同时为空<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/92135"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/add_msg_template")]
        Task<AddTemplateApiResult> AddTemplateAsync([JsonNetContent(CharSet = "utf-8")] AddTemplateInput input);

        // /// <summary>
        // /// 提醒成员群发<para/>
        // /// 
        // /// 企业和第三方应用可调用此接口，重新触发群发通知，提醒成员完成群发任务，24小时内每个群发最多触发三次提醒。<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/97610"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/remind_groupmsg_send")]
        // Task<ApiResultBase> RemindSendAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] RemindSendInput input);

        /// <summary>
        /// 提醒成员群发<para/>
        /// 
        /// 企业和第三方应用可调用此接口，重新触发群发通知，提醒成员完成群发任务，24小时内每个群发最多触发三次提醒。<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/97610"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/remind_groupmsg_send")]
        Task<ApiResultBase> RemindSendAsync([JsonNetContent(CharSet = "utf-8")] RemindSendInput input);

        // /// <summary>
        // /// 停止企业群发<para/>
        // /// 
        // /// 企业和第三方应用可调用此接口，停止无需成员继续发送的企业群发<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/97611"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/cancel_groupmsg_send")]
        // Task<ApiResultBase> CancelSendAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] CancelSendInput input);

        /// <summary>
        /// 停止企业群发<para/>
        /// 
        /// 企业和第三方应用可调用此接口，停止无需成员继续发送的企业群发<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/97611"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/cancel_groupmsg_send")]
        Task<ApiResultBase> CancelSendAsync([JsonNetContent(CharSet = "utf-8")] CancelSendInput input);

        // /// <summary>
        // /// 获取群发记录列表<para/>
        // /// 
        // /// 企业和第三方应用可通过此接口获取企业与成员的群发记录。<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/97611"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/get_groupmsg_list_v2")]
        // Task<MessageListApiResult> GetListAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] QueryMessageInput input);

        /// <summary>
        /// 获取群发记录列表<para/>
        /// 
        /// 企业和第三方应用可通过此接口获取企业与成员的群发记录。<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/97611"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/get_groupmsg_list_v2")]
        Task<MessageListApiResult> GetListAsync([JsonNetContent(CharSet = "utf-8")] QueryMessageInput input);

        // /// <summary>
        // /// 获取群发成员发送任务列表<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/93338#%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%8F%91%E6%88%90%E5%91%98%E5%8F%91%E9%80%81%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/get_groupmsg_task")]
        // Task<TaskApiResult> GetGroupMessageTaskAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] TaskInput input);

        /// <summary>
        /// 获取群发成员发送任务列表<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/93338#%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%8F%91%E6%88%90%E5%91%98%E5%8F%91%E9%80%81%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/get_groupmsg_task")]
        Task<TaskApiResult> GetGroupMessageTaskAsync([JsonNetContent(CharSet = "utf-8")] TaskInput input);

        // /// <summary>
        // /// 获取企业群发成员执行结果<para/>
        // /// <see url="https://developer.work.weixin.qq.com/document/path/93338#%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%8F%91%E6%88%90%E5%91%98%E5%8F%91%E9%80%81%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8"/>
        // /// </summary>
        // /// <param name="access_token">调用接口凭证</param>
        // /// <param name="input"></param>
        // /// <returns></returns>
        // [HttpPost("externalcontact/get_groupmsg_send_result")]
        // Task<SendResult> GetGroupMessageSendResultAsync([Required] string access_token, [JsonNetContent(CharSet = "utf-8")] SendInput input);

        /// <summary>
        /// 获取企业群发成员执行结果<para/>
        /// <see url="https://developer.work.weixin.qq.com/document/path/93338#%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%8F%91%E6%88%90%E5%91%98%E5%8F%91%E9%80%81%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8"/>
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("externalcontact/get_groupmsg_send_result")]
        Task<SendResult> GetGroupMessageSendResultAsync([JsonNetContent(CharSet = "utf-8")] SendInput input);
    }
}
